﻿using System;
using ANX.Framework;
using ANX.Framework.Graphics;

namespace ANXGame.Model
{
    [Serializable]
    public struct BlockVertex : ANX.Framework.Graphics.IVertexType
    {
        public static readonly VertexElement[] VertexElements =
            new[]
                {
                    new VertexElement(0, VertexElementFormat.Vector4, VertexElementUsage.Position, 0),
                    new VertexElement(sizeof (float)*4, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate,0),
                };

        public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration(VertexElements);

        VertexDeclaration IVertexType.VertexDeclaration
        {
            get { return VertexDeclaration; }
        }

        public static readonly int BlockVertexSize = sizeof (float)*4 + sizeof (float)*2;

        public BlockVertex(Vector4 position, Vector2 coord)
        {
            Position = position;
            TextureCoordinate1 = coord;
        }

        public Vector4 Position;
        public Vector2 TextureCoordinate1;
    }
}